package com.xinruke.hostels.reservation.controller.pms;

import com.xinruke.hostels.common.controller.BaseController;
import com.xinruke.hostels.common.vo.ResultVO;
import com.xinruke.hostels.reservation.interfaces.dto.pms.TeamBookingDTO;
import com.xinruke.hostels.reservation.interfaces.dto.pms.TeamBookingResultDTO;
import com.xinruke.hostels.reservation.service.pms.TeamRoomService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @ClassName TeamRoomController
 * @CreateDate 2019/7/15
 * @Author FengXinQiang
 * @Version V1.0.0.0
 * @Decription 团队房间controller
 */
@RestController
@RequestMapping("/team/room")
@Api(tags = "pms团队房间")
@Slf4j
public class TeamRoomController extends BaseController {
    @Autowired
    TeamRoomService teamRoomService;

    @PostMapping("/booking")
    @ApiOperation("预订")
    public ResultVO<TeamBookingResultDTO> booking(@RequestBody @Valid TeamBookingDTO teamBookingDTO) {
        ResultVO<TeamBookingResultDTO> resultVO = ResultVO.fail();

        resultVO = teamRoomService.booking(teamBookingDTO);

        return resultVO;
    }

}
